//
//  KLColor.m
//  kunlun
//
//  Created by zhusanbao on 2020/9/26.
//  Copyright © 2020 zhusanbao. All rights reserved.
//

#import "KLColors.h"

#define kKLCVWrapper(h1,h2) @#h1:@#h2

static inline NSDictionary *_KL_COLORS_SET(){
    static NSDictionary *_KL_DY_COLORS_DIC = nil;
    if (!_KL_DY_COLORS_DIC) {
        static dispatch_once_t onceToken;
        dispatch_once(&onceToken, ^{
            _KL_DY_COLORS_DIC = @{kKLCVWrapper(#00B9FF, #009CFF),
                                  kKLCVWrapper(#00EAFF, #009CFF),
                                  kKLCVWrapper(#FE555C, #EA4D3D),
                                  kKLCVWrapper(#FF0036, #EA4D3D),
                                  kKLCVWrapper(#333333, #FFFFFF),
                                  kKLCVWrapper(#666666, #88888D),
                                  kKLCVWrapper(#999999, #7E7E7E),
                                  kKLCVWrapper(#FFFFFF, #000000),
                                  kKLCVWrapper(#F7F7F7, #19191A),
                                  kKLCVWrapper(#F7F7F8, #313133),
                                  kKLCVWrapper(#E5E5E5, #3D3D40),
                                  kKLCVWrapper(#EEEEEE, #3D3D40),
                                  kKLCVWrapper(#FF0000, #EA4D3D),
                                  kKLCVWrapper(#FEAF5F, #F09A37),
                                  kKLCVWrapper(#FF0036, #EA4D3D),
                                  kKLCVWrapper(#000000, #FFFFFF),
                                  kKLCVWrapper(#3B4066, #3B4066)
                                  };
        });
    }
    return _KL_DY_COLORS_DIC;
}

/** 正常模式/暗黑模式对应色值 */
NSString *_KL_SAMPLE_COLOR(NSString *hex){
#if DEBUG
    NSString *newHex = _KL_COLORS_SET()[hex];
//    if (!newHex) {
//        KLLog(@"⚠️⚠️⚠️⚠️未找到暗黑模式[%@]对应色值⚠️⚠️⚠️⚠️\n",hex);
//    }
    return newHex;
#else
    return _KL_COLORS_SET()[hex];
#endif
}
///** 背景是黑色匹配颜色 */
//NSString *_KL_DARK_COLOR(NSString *hex){
//    return _KL_DARK_COLORS()[hex];
//}
#undef kCVWrapper

@implementation KLColors

@end
